﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {

        Icon Icon1;
        Icon Icon2;
        int changeLanguage;
       

        public Form1()
        {
         
            InitializeComponent();
            Icon1 = this.Icon;
            changeLanguage = 0;
        }
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo (lang));
            }
        }


        private void button2_Click(object sender, EventArgs e)
        {
            Form2 f2 = new Form2();
            f2.Show();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
           
            Icon2 = new Icon("C:\\IDE\\Assignment2\\IDE_week2_Solution\\IDE_week2_Forms_project\\Resources\\Icon1.ico");
            this.Icon = Icon2;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.Icon = Icon1;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (changeLanguage == 0)
            {
                this.ChangeLanguage("ro");
                changeLanguage = 1;
            }
            else 
            {
                this.ChangeLanguage("en");
            changeLanguage = 0;
            }
        }
    }
}
